package com.hbnu.system.controller;



import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.Xmlb;
import com.hbnu.system.service.XmlbService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 项目类别(Xmlb)表控制层
 *
 * @author makejava
 * @since 2024-12-21 21:31:28
 */
@RestController
@RequestMapping("/Xmlb")
@Api(tags = "项目类别模块")
public class XmlbController {
    
    @Autowired
    private XmlbService xmlbService;

    @ApiOperation("项目类别添加")
    @PostMapping("/addXmlb")
    public Rest<Boolean> addXmlb(@RequestBody Xmlb xmlb){
        boolean add = xmlbService.addXmlb(xmlb);
        return add ? Rest.success() : Rest.failed();
    }

    @ApiOperation("项目类别删除")
    @GetMapping("/deletePaperQulification")
    public Rest<Boolean> deletePaperQulification(String XmlbID){
        boolean delete = xmlbService.deleteXmlb(XmlbID);
        return delete ? Rest.success() : Rest.failed();
    }

    @ApiOperation("项目类别查看")
    @GetMapping("/getPaperQulification")
    public Rest<List<Xmlb>> getPaperQulification(){
        List<Xmlb> onePaper_qualification = xmlbService.getOneXmlb();

        return Rest.success(onePaper_qualification);
    }
}

